<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .main {
            width: 400px;
            height: 1200px;
            background-color: #333;
            position: relative;
            overflow: hidden;
            left: 100px;
        }

        .child1 {
            overflow: hidden;
            width: 100px;
            height: 100px;
            position: absolute;
            left: 20px;
            top: 40px;
            background-color: blue;
        }

        .child2 {
            z-index: 99;
            width: 100px;
            height: 100px;
            overflow: hidden;
            background-color: aqua;
        }

        .child3 {
            width: 100px;
            height: 100px;
            background: yellow;
        }

        .c::after {
            content: "";
            display: block;
            clear: both;

        }
    </style>

</head>

<body>
    a
    <div class="main ">
        <div class="child1">child1</div>
        <div class="child2">child2</div>
        <div class="child3">child3</div>
        <div></div>
    </div>

</body>

</html>